﻿using NfsBLL;
using NfsCommon.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ManagerWed.Controllers
{
    public class PasswordController : Controller
    {
        //
        // GET: /Password/
        public ActionResult Index()
        {
            ViewData["user_name"] = CookieHelper.GetDecodeCookie("pcnfs_user_name");
            return View();
        }
        #region  修改密码
        [HttpPost]
        public JsonResult UptPassword(string pwd)
        {
            try
            {
                int id = 1;
                AccountBLL bll = new AccountBLL();
                bool flag = bll.UptPassword(id, pwd);
                if (flag == true)
                {
                    return Json(new { MessageCode = "0" }, JsonRequestBehavior.AllowGet);

                }
                else {

                    return Json(new { MessageCode = "100"}, JsonRequestBehavior.AllowGet);
                }

            }
            catch (Exception)
            {

                return Json(new { MessageCode = "200" }, JsonRequestBehavior.AllowGet);

            }
           
        }
        #endregion
    }
}